package com.bitdf.txing.order.feign;

import com.bitdf.txing.common.utils.R;
import com.bitdf.txing.order.config.FeignInterceptor;
import com.bitdf.txing.order.vo.WareSkuLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(
        name = "tx-mall-ware",                 // 服务名称
        configuration = FeignInterceptor.class       // 请求拦截器 （关键代码）
)
public interface OrderWmsFeignService {

    @PostMapping("txing/mall/ware/sku/hasstock")
    R getSkuHasStock(@RequestBody List<Long> skuIds);

    @GetMapping("/txing/mall/ware/wareinfo/fare")
    R getFare(@RequestParam("addrId") Long addrId);

    /**
     * 下订单 锁库存
     * @param vo
     * @return
     */
    @PostMapping("/txing/mall/ware/sku/lock/order")
    R orderLockStock(@RequestBody WareSkuLockVo vo);
}
